<script lang="ts">
  import SucessIcon from './success.svelte'
  import ErrorIcon from './error.svelte'
  import InfoIcon from './info.svelte'
  import WarningIcon from './warning.svelte'

  export let type: IconType
  export let iconStyle = ''
</script>

<div style="display: inline-flex;">
  {#if type === 'error'}
    <ErrorIcon />
  {:else if type === 'success'}
    <SucessIcon />
  {:else if type === 'info'}
    <InfoIcon />
  {:else if type === 'warning'}
    <WarningIcon />
  {:else}
    <img
      style={'width: 32px; height: 32px;' + { iconStyle }}
      src={type}
      alt=""
    />
  {/if}
</div>
